home *** CD-ROM | disk | FTP | other *** search
/ El Mac 9 / El Mac 9.iso / Shareware / Applications / MathPad 2.4 / XFuns / XFun kit / histogram src / histogram..rsrc / histogram..rsrc.rsrc / TEXT_128_histogram().txt
Encoding:
Text File  |  1994-06-11  |  513 b   |  14 lines

  1. -- histogram(arr,lo,hi,nbins)
  2.  
  3. -- Accumulates a histogram of the values in array 'arr'. Parameters 'lo' and 'hi' give the range of interest. Parameter nbins tell how many bins to divide the range into.
  4. -- histogram() returns the number of points that fell within the range.
  5. -- Global variable 'bins' is set to the histogram array.
  6. -- Global variable 'mean' is set to the mean of values within the range.
  7.  
  8. a={1,2,3,2,4,4,4,5,3,6,4}
  9.  
  10. Xmin=1; Xmax=10;
  11. histogram(a,Xmin,Xmax,10):11.000
  12. plotline bins
  13. label mean:3.455
  14.